package com.cyh.testdesignpattern.mediator;


import android.util.Log;

//窗帘， 具体的同事类
public class Curtains extends Colleague {

    public Curtains(Mediator mediator, String name) {
        super(mediator, name);

        mediator.register(name, this);
    }

    @Override
    public void sendMessage(int stateChange) {
        getMediator().getMessage(stateChange, getName());
    }

    public void switchMessage(int stateChange) {
        //如果自己无法处理消息，就告诉中介者让其他人处理
        Log.i("CurTains", "----Curtains---处理不了消息---加消息转发" );
        sendMessage(stateChange);
    }
    public void upCurtains() {
        Log.i("CurTains", "----Curtains---处理了消息--窗帘拉上" );
    }

    public void downCurtains() {
        Log.i("CurTains", "----Curtains---处理了消息--窗帘拉下" );
    }
}
